using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.WindowsAzure;
using Microsoft.WindowsAzure.Diagnostics;
using Microsoft.WindowsAzure.ServiceRuntime;
using Microsoft.WindowsAzure.StorageClient;
using Microsoft.CloudSaver.Web.Infrastructure;
using System.Web;

namespace Microsoft.CloudSaver.Web
{
    public class WebRole : RoleEntryPoint
    {
        public override bool OnStart()
        {
            //DiagnosticMonitor.Start("Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString");
            RoleEnvironment.Changing += this.RoleEnvironmentChanging;            
            return base.OnStart();
        }
        
        private void RoleEnvironmentChanging(object sender, RoleEnvironmentChangingEventArgs e)
        {            
            if (e.Changes.Any(change => change is RoleEnvironmentConfigurationSettingChange))
            {                
                e.Cancel = true;
            }
        }
    }
}
